package config;

import java.io.IOException;
import java.io.InputStream;
import java.util.Properties;

public class PropertyConfig implements GlobalConfig{

	static private String config_default_path=CONFIG_SOKET_INFO_PATH;
	
	static private Properties properties = new Properties();
	
	static{
		InputStream is = PropertyConfig.class.getResourceAsStream(config_default_path);
		try {
			properties.load(is);
			is.close();
		} catch (IOException e) {
			e.printStackTrace();
		}
	}
	
	public PropertyConfig(String path){
		config_default_path=path;
	}
	
	static public String getPropertyByKey(String key){
		return properties.getProperty(key);
	}
	
	/**
	 * @param args
	 */
	public static void main(String[] args) {
		System.out.println(PropertyConfig.getPropertyByKey("server_IP"));
	}

}
